import java.util.Objects;

public class Film {
    private Integer id;
    private String name;
    private String release_date;
    private String duration;

    public Film(Integer id, String name, String release_date, String duration) {
        this.id = id;
        this.name = name;
        this.release_date = release_date;
        this.duration = duration;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRelease_date() {
        return release_date;
    }

    public void setRelease_date(String release_date) {
        this.release_date = release_date;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        Film f = (Film) obj;
        return Objects.equals(this.id, f.id)
                && Objects.equals(this.name, f.name)
                && Objects.equals(this.release_date, f.release_date)
                && Objects.equals(this.duration, f.duration);
    }

    @Override
    public String toString() {
        return String.format("%1$-5s%2$-10s%3$-15s%4$-10s", this.id, this.name, this.release_date, this.duration);
    }
}
